API - Cache\Page_cache
system\cache.php at line 417

Class Page_cache

Page_cache

public class Page_cache

A cache that stores entire page outputs. Disk-based.

Field Summary
private mixed

$dir

Cache root

private mixed

$excl

Parameters to exclude

private mixed

$ext

Filename extension

private mixed

$filename

Full path to page cache image

private mixed

$name

Short file name

private mixed

$path

Relative page (item) path

private mixed

$perms

Directory permissions

Constructor Summary
void

__construct(string dir, int perms)

Constructs controller object and sets basic configuration

Method Summary
int

clear(string path)

Removes an item and all contained items and cache files

void

init(string path, string name, array exclude, string ext)

Initializes actual page cache

void

read()

Reads the page cache object from disk and sends it to output.

void

write()

Writes output buffer contents to a cache image file

private int

rm_r(string path)

Removes a directory with all its contents recursively

Field Detail

system\cache.php at line 422

dir

private mixed $dir = COT_DEFAULT_REALM
Cache root

system\cache.php at line 434

excl

private mixed $excl
Parameters to exclude

system\cache.php at line 438

ext

private mixed $ext
Filename extension

system\cache.php at line 442

filename

private mixed $filename
Full path to page cache image

system\cache.php at line 430

name

private mixed $name
Short file name

system\cache.php at line 426

path

private mixed $path
Relative page (item) path

system\cache.php at line 446

perms

private mixed $perms
Directory permissions

Constructor Detail

system\cache.php at line 453

__construct

public void __construct(string dir, int perms)
Constructs controller object and sets basic configuration
Parameters:
dir - Cache directory
perms - Octal permission mask for cache directories

Method Detail

system\cache.php at line 464

clear

public int clear(string path)
Removes an item and all contained items and cache files
Parameters:
path - Item path
Returns:
Number of files removed

system\cache.php at line 476

init

public void init(string path, string name, array exclude, string ext)
Initializes actual page cache
Parameters:
path - Page path string
name - Short name for the cache file
exclude - A list of GET params to be excluded from consideration
ext - File extension

system\cache.php at line 489

read

public void read()
Reads the page cache object from disk and sends it to output. If the cache object does not exist, then just calculates the path for a following write() call.

system\cache.php at line 557

write

public void write()
Writes output buffer contents to a cache image file

system\cache.php at line 574

rm_r

private int rm_r(string path)
Removes a directory with all its contents recursively
Parameters:
path - Directory path
Returns:
Number of items removed